]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shell-app: Ignore invalid window PIDs
authorJonas Dreßler <verdre@v0yd.nl>
Mon, 6 Apr 2020 18:31:46 +0000 (20:31 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Mon, 6 Apr 2020 21:53:37 +0000 (21:53 +0000)
When building the list of window PIDs, it's possible Mutter doesn't know
about the PID the client has and meta_window_get_pid() will return 0. We
should handle this case by not adding the PID to the list of PIDs
instead of adding an invalid one to it.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1184

src/shell-app.c

index dfa7fe7570c932a79e4861cad14be2d026b6d066..f72cba15d29594bc9cf0f309efa3a46231f07c11 100644 (file)
@@ -1159,6 +1159,10 @@ shell_app_get_pids (ShellApp *app)
     {
       MetaWindow *window = iter->data;
       int pid = meta_window_get_pid (window);
+
+      if (pid < 1)
+        continue;
+
       /* Note in the (by far) common case, app will only have one pid, so
        * we'll hit the first element, so don't worry about O(N^2) here.
        */